oracle.pg.text.solr

## Class SolrAutoIndex<T extends Element>

- java.lang.Object
- - oracle.pg.text.solr.SolrIndex<T>
  - - oracle.pg.text.solr.SolrAutoIndex<T>

- All Implemented Interfaces:
    Index<T>, OracleAutoIndex<T>, OracleIndex<T>
  Direct Known Subclasses:
    SolrEdgeAutoIndex, SolrVertexAutoIndex

      public abstract class SolrAutoIndex<T extends Element>
      extends SolrIndex<T>
      implements OracleAutoIndex<T>

  This class extends the functions defined in SolrIndex and implements OracleAutoIndex interface to support automatic text indices using SolrCloud.

- - ### Field Summary

    - ### Fields inherited from class oracle.pg.text.solr.SolrIndex

      `EDGE_ID_PROP, TYPE_DT_BOOL, TYPE_DT_DATE, TYPE_DT_DOUBLE, TYPE_DT_FLOAT, TYPE_DT_INTEGER, TYPE_DT_SERIALIZABLE, TYPE_DT_STRING, VERSION_PROP, VERTEX_ID_PROP`

    - ### Fields inherited from interface oracle.pg.text.OracleIndex

      `EDGE_ID_PROP, EDGE_LABEL_PROP, END_NODE_ID_PROP, START_NODE_ID_PROP, TYPE_DT_BOOL, TYPE_DT_DATE, TYPE_DT_DOUBLE, TYPE_DT_FLOAT, TYPE_DT_INTEGER, TYPE_DT_SERIALIZABLE, TYPE_DT_STRING, VERTEX_ID_PROP`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SolrAutoIndex(String indexName, Class<T> indexClass, OraclePropertyGraphBase graph, Parameter<String,Object>[] indexParameters, boolean erase)` Constructs a new SolrAutoIndex object.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Closes this index object.
    `abstract void` | `closeConnectionsArray()` Closes the connection array used for parallel scan in parallel indexing.
    `boolean` | `containsIndexedKey(String key)` Verifies if the specified key is used in the automatic index.
    `abstract Object[]` | `getConnectionsArray()` Gets the connection array used for parallel scan in parallel indexing.
    `abstract Iterable<T>` | `getElementsFromPG()` Gets an Iterable<T> of elements from the associated property graph, matching the specified key.
    `Set<String>` | `getIndexedKeys()` Get the keys associated to this auto index.
    `void` | `indexElements()` Index elements in a property graph with respect to the current indexed keys.
    `void` | `indexElementsPartitioned()` Index elements in a property graph with respect to the current indexed keys using getPartitioned APIs.
    `List<String>` | `loadIndexedKeys()` Gets all the indices associated to this property graph and defined in the index meta data table.
    `void` | `put(String key, Object value, T element, org.apache.solr.client.solrj.impl.CloudSolrServer cloudSolrServer)` Indexes an element with respect to the specified key and value.
    `void` | `reindexElements()` Re-index the elements of the associated property graph based on the current indexed keys.
    `void` | `reindexElements(String key)` Re-index the elements of the associated property graph based on the specified key.
    `void` | `reindexElements(String[] indexedKeys)` Re-index the elements of the associated property graph based on the specified set of keys.
    `void` | `reindexElementsNoPartitioned(String[] indexedKeys)` Re-index the elements of the associated property graph based on the specified set of keys.
    `void` | `reindexElementsPartitioned()` Re-index the elements of the associated property graph based on the current indexed keys using getElementsPartitioned APIs.
    `void` | `reindexElementsPartitioned(String key)` Re-index the elements of the associated property graph based on the specified key using getElementsPartitioned APIs.
    `void` | `reindexElementsPartitioned(String[] indexedKeys)` Re-index all elements over a partitioned graph based on the specified set of keys.

    - ### Methods inherited from class oracle.pg.text.solr.SolrIndex

      `add, add, buildSearchTerm, buildSearchTerm, clearIndex, commit, count, count, count, dropIndex, get, get, get, getCloudSolrServer, getDirectoryName, getDocIdentifier, getGraphName, getIndexClass, getIndexName, getIndexParameters, getOracleIndexParameters, getParameters, getPartitioned, getPartitioned, getShardsNames, getTotalShards, getTotalShards, isDelBatchEmpty, isDelBatchFull, isUpdatesBatchEmpty, isUpdatesBatchFull, put, query, query, remove, remove, remove, remove, removeAll`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface oracle.pg.text.OracleAutoIndex

      `get, getElementsFromPG, getElementsFromPG, getElementsFromPG, getPartitionsNumber`

    - ### Methods inherited from interface oracle.pg.text.OracleIndex

      `add, buildSearchTerm, buildSearchTerm, clearIndex, commit, count, count, dropIndex, get, getDirectoryName, getDocIdentifier, getGraphName, getIndexClass, getOracleIndexParameters, getParameters, getPartitioned, getPartitioned, getTotalShards, isDelBatchEmpty, isDelBatchFull, isUpdatesBatchEmpty, isUpdatesBatchFull, query, refreshIndex, remove, removeAll`

    - ### Methods inherited from interface com.tinkerpop.blueprints.Index

      `count, get, getIndexName, put, query, remove`

- - ### Constructor Detail

    - #### SolrAutoIndex

          public SolrAutoIndex(String indexName,
                       Class<T> indexClass,
                       OraclePropertyGraphBase graph,
                       Parameter<String,Object>[] indexParameters,
                       boolean erase)

      Constructs a new SolrAutoIndex object.
      Parameters:
        `indexName` - the name of the index.
        `indexClass` - the element class that this index is indexing (can be base class Vertex/Edge)
        `graph` - an `OraclePropertyGraphBase` object.
        `indexParameters` - a collection of parameters for the underlying index implementation.
        `erase` - a boolean specifying if the index should be cleared at the beginning.

  - ### Method Detail

    - #### close

          public void close()

      Closes this index object. This operation will flush and commit all changes executed over the index.
      Specified by:
        `close` in interface `OracleIndex<T extends Element>`
      Overrides:
        `close` in class `SolrIndex<T extends Element>`

    - #### closeConnectionsArray

          public abstract void closeConnectionsArray()

      Closes the connection array used for parallel scan in parallel indexing.
      Specified by:
        `closeConnectionsArray` in interface `OracleAutoIndex<T extends Element>`

    - #### containsIndexedKey

          public boolean containsIndexedKey(String key)

      Verifies if the specified key is used in the automatic index.
      Specified by:
        `containsIndexedKey` in interface `OracleAutoIndex<T extends Element>`
      Parameters:
        `key` - the key to validate if exists within the automatic index.
      Returns:
        true if the key is used in the automatic index.

    - #### getConnectionsArray

          public abstract Object[] getConnectionsArray()
                                                throws Exception

      Gets the connection array used for parallel scan in parallel indexing.
      Specified by:
        `getConnectionsArray` in interface `OracleAutoIndex<T extends Element>`
      Returns:
        an array of Connection objects
      Throws:
        `Exception`

    - #### getElementsFromPG

          public abstract Iterable<T> getElementsFromPG()

      Gets an Iterable<T> of elements from the associated property graph, matching the specified key.
      Specified by:
        `getElementsFromPG` in interface `OracleAutoIndex<T extends Element>`
      Returns:
        an Iterable<T> object.

    - #### getIndexedKeys

          public final Set<String> getIndexedKeys()

      Get the keys associated to this auto index.
      Specified by:
        `getIndexedKeys` in interface `OracleAutoIndex<T extends Element>`
      Returns:
        the set of keys used in this index.

    - #### indexElements

          public final void indexElements()

      Index elements in a property graph with respect to the current indexed keys.
      Specified by:
        `indexElements` in interface `OracleAutoIndex<T extends Element>`

    - #### indexElementsPartitioned

          public final void indexElementsPartitioned()

      Index elements in a property graph with respect to the current indexed keys using getPartitioned APIs.
      Specified by:
        `indexElementsPartitioned` in interface `OracleAutoIndex<T extends Element>`

    - #### loadIndexedKeys

          public List<String> loadIndexedKeys()

      Gets all the indices associated to this property graph and defined in the index meta data table.
      Specified by:
        `loadIndexedKeys` in interface `OracleAutoIndex<T extends Element>`

    - #### put

          public final void put(String key,
                 Object value,
                 T element,
                 org.apache.solr.client.solrj.impl.CloudSolrServer cloudSolrServer)

      Indexes an element with respect to the specified key and value.
      Overrides:
        `put` in class `SolrIndex<T extends Element>`
      Parameters:
        `key` - the key to index the element by.
        `value` - the value to index the element by.
        `element` - the element to index.
        `cloudSolrServer` - if not null, use the opened CloudSolrServer connection, this avoids opening/closing a CloudSolrServer connection at flush time.

    - #### reindexElements

          public void reindexElements()

      Re-index the elements of the associated property graph based on the current indexed keys.
      Specified by:
        `reindexElements` in interface `OracleAutoIndex<T extends Element>`

    - #### reindexElements

          public void reindexElements(String key)

      Re-index the elements of the associated property graph based on the specified key.
      Specified by:
        `reindexElements` in interface `OracleAutoIndex<T extends Element>`
      Parameters:
        `key` - the key to use for re-indexing.

    - #### reindexElements

          public void reindexElements(String[] indexedKeys)

      Re-index the elements of the associated property graph based on the specified set of keys.
      Specified by:
        `reindexElements` in interface `OracleAutoIndex<T extends Element>`
      Parameters:
        `indexedKeys` - an array of the indexed keys to use for re-indexing.

    - #### reindexElementsNoPartitioned

          public void reindexElementsNoPartitioned(String[] indexedKeys)

      Re-index the elements of the associated property graph based on the specified set of keys.
      Specified by:
        `reindexElementsNoPartitioned` in interface `OracleAutoIndex<T extends Element>`
      Parameters:
        `indexedKeys` - an array of the indexed keys to use for re-indexing.

    - #### reindexElementsPartitioned

          public void reindexElementsPartitioned()

      Re-index the elements of the associated property graph based on the current indexed keys using getElementsPartitioned APIs.
      Specified by:
        `reindexElementsPartitioned` in interface `OracleAutoIndex<T extends Element>`

    - #### reindexElementsPartitioned

          public void reindexElementsPartitioned(String key)

      Re-index the elements of the associated property graph based on the specified key using getElementsPartitioned APIs.
      Specified by:
        `reindexElementsPartitioned` in interface `OracleAutoIndex<T extends Element>`
      Parameters:
        `key` - the key to use for re-indexing.

    - #### reindexElementsPartitioned

          public void reindexElementsPartitioned(String[] indexedKeys)

      Re-index all elements over a partitioned graph based on the specified set of keys. This approach will use getPartitioned APIs to re-index elements in parallel.
      Specified by:
        `reindexElementsPartitioned` in interface `OracleAutoIndex<T extends Element>`
      Parameters:
        `indexedKeys` - an array of keys to be indexed.

Copyright © 2015 Oracle and/or its affiliates. All Rights Reserved.